# To change this template, choose Tools | Templates
# and open the template in the editor.
import sys

from xml.dom import minidom
from xml.etree import ElementTree as ET

__author__="muchmeck"
__date__ ="$Dec 20, 2010 8:20:49 PM$"

WIN_PROJECT_PATH = 'e:/programming/projectSettings.xml'
LNX_PROJECT_PATH = '/media/Project/programming/projectSettings.xml'

  
def xmlParser(projectPath):

    try:
        element = ET.parse(projectPath)
    except Exception, inst:
        print "Unexpected error opening %s: %s" % (projectPath, inst)
        return
    a = []
    print a
    print element._root


    for subelement in element._root:
            a.append(subelement.attrib)
            a.append(subelement.text)

    return a

if __name__ == "__main__":
    print "Hello World"
    if sys.platform== "win32":
        result = xmlParser(WIN_PROJECT_PATH)
    else:
        result = xmlParser(LNX_PROJECT_PATH)
    print result
    print result[0]['attribute']




